package model

import business.Attackable
import business.Blockable
import business.Destroyable
import business.Sufferable
import org.itheima.kotlin.game.core.Painter

open class Wall(i:Int, j:Int):Blockable,Sufferable,Destroyable {
    override var blood: Int=3
    override var width: Int=Config.block
    override var height: Int=Config.block
    override var x: Int=width*j
    override var y: Int=height*i

    override public fun draw(){
        Painter.drawImage("img/wall.gif",x,y)
    }

    override fun isDestroy(): Boolean {
        if(this.blood<=0) {
            return true
        }
        return false
    }

    override fun notifySuffer(attack: Attackable):Array<IView>? {
        this.blood-=attack.attackPower
        return arrayOf(Blast(x,y))
    }

}